package com.batchbrake.queue;

import java.util.Observable;
import java.util.Observer;

import javax.swing.event.TableModelEvent;
import javax.swing.event.TableModelListener;
import javax.swing.table.DefaultTableModel;
import javax.swing.tree.TreePath;

import com.batchbrake.main.BatchBrakeProc;

public class QueueTableModel extends DefaultTableModel {
	public static int COL_TITLE = 0;
	private BatchBrakeProc proc = null;
	
	public QueueTableModel(BatchBrakeProc proc) {
		this.proc = proc;
	}
	
	@Override
	public Class<?> getColumnClass(int col) {
		return QueueEntity.class;
	}

	@Override
	public int getColumnCount() {
		return 1;
	}

	@Override
	public String getColumnName(int col) {
		return null;
	}

	@Override
	public int getRowCount() {
		if( proc != null ) {
			return proc.queue.size();
		} else {
			return 0;
		}
	}

	@Override
	public Object getValueAt(int row, int col) {
		return proc.queue.get(row);
	}

	@Override
	public boolean isCellEditable(int row, int col) {
		return false;
	}

}
